package com.coyote.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


@Data
@Schema(name = "Example", description = "示例实体类2")
@TableName("hello_order")
public class HelloOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键id", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "名字", example = "张三")
    @TableField("name")
    private String name;

    @Schema(description = "用户名", example = "zhangsan")
    @TableField("user_name")
    private String userName;

    @Schema(description = "手机号码", example = "18812345678")
    @TableField("phone")
    private String phone;

    @Schema(description = "电子邮箱", example = "12345678@qq.com")
    @TableField("email")
    private String email;

    @Schema(description = "账户余额", example = "100.00")
    @TableField("money")
    private BigDecimal money;

    @Schema(description = "账户余额(更多)", example = "100.00")
    @TableField("money_more")
    private BigDecimal moneyMore;

    @Schema(description = "20位以类的数字", example = "123456789012")
    @TableField("card_id")
    private Long cardId;

    @TableField("user_type")
    @Schema(description = "1位tinyint", example = "1", allowableValues = "0,1")
    private Integer userType;

    @TableField("user_type_two")
    @Schema(description = "2位tinyint", example = "10")
    private Integer userTypeTwo;

    @Schema(description = "创建时间", example = "2023-09-10 10:10:10")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @Schema(description = "修改时间", example = "2023-09-10 10:10:10")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Schema(description = "2位数的double", example = "99.99")
    @TableField("num_double")
    private Double numDouble;

    @Schema(description = "char数据", example = "A")
    @TableField("num_char")
    private String numChar;

    @Schema(description = "year数据", example = "2023")
    @TableField("num_year")
    private Integer numYear;

    @Schema(description = "date数据", example = "2023-03-23")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField("num_date")
    private Date numDate;

    @Schema(description = "time数据 小时分钟秒(可以表示从'00:00:00'到'23:59:59'之间的任何时间)", example = "10:10:10")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @TableField("time_num")
    private Date timeNum;

    @Schema(description = "mysql的枚举类型", example = "enum('Value1','Value2','Value3')")
    @TableField("enum_status")
    private String enumStatus;

    @Schema(description = "text文本数据", example = "String")
    @TableField("remarks")
    private String remarks;

    @Schema(description = "float数据", example = "1")
    @TableField("num_float")
    private Float numFloat;

    @Schema(description = "bold数据", example = "请将字段类型改为：byte[]；传值：Base64进行编码的字符串即可,例如：SGVsbG8gV29ybGQh ")
    @TableField("num_blob")
    private byte[] numBlob;

    @Schema(description = "乐观锁版本号", example = "1")
    @TableField("revision")
    @Version
    private Integer revision;

    @Schema(description = "是否逻辑删除 (默认0是false,1是true) (0是false,1是true))", example = "0")
    @TableField("logic_delete")
    @TableLogic
    private Boolean logicDelete;
}
